package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AdBannerFallBack;
import cn.cs.fallback.AgentTypeFallBack;
import cn.cs.pojo.AdBanner;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-shop-provider", configuration = CsConfiguration.class, fallback = AdBannerFallBack.class)
public interface AdBannerClient {


    @RequestMapping(value = "/getAdbannerById", method = RequestMethod.POST)
    public AdBanner getAdbannerById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getAdbannerListByMap", method = RequestMethod.POST)
    public List<AdBanner> getAdbannerListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getAdbannerCountByMap", method = RequestMethod.POST)
    public Integer getAdbannerCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addAdbanner", method = RequestMethod.POST)
    public Integer addAdbanner(@RequestBody AdBanner adbanner) throws Exception;

    @RequestMapping(value = "/modifyAdbanner", method = RequestMethod.POST)
    public Integer modifyAdbanner(@RequestBody AdBanner adbanner) throws Exception;

    @RequestMapping(value = "/deleteAdbannerById", method = RequestMethod.POST)
    public Integer deleteAdbannerById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getAllAdBanners", method = RequestMethod.POST)
    List<AdBanner> getAllAdBanners(@RequestParam("type")String type);
}

